#!/bin/sh -eux

# IMAGE_NAME ($DOCKER_REPO:$DOCKER_TAG)
#   shellspec/shellspec:<TAG>
#   shellspec/shellspec-<VARIANT>:<VERSION>

case $DOCKER_REPO in
  *-scratch) exit
esac

# Build kcov image
case $DOCKER_TAG in
  latest) IMAGE_NAME="$DOCKER_REPO:kcov" ;;
  *     ) IMAGE_NAME="$IMAGE_NAME-kcov" ;;
esac
DOCKER_TAG=${IMAGE_NAME#*:}
"$(dirname "$0")/build" --target kcov
